<form name="loginForm" #loginForm="ngForm" (ngSubmit)="onLogin()" (keyup)="onKeyLogin($event)" autocomplete="off">
  <div fxLayout="column" fxFlexFill fxLayoutAlign="center center" class="bg">
    <div class="login" fxLayout="column">
      <div class="logo" fxLayout="column">
        <div fxLayout="row">
          <div class="logo-img"> </div>
          <div class="appTitle">
            {{application?.appConfigData?.appTitle}}
          </div>
        </div>
        <div class="appSubTitle">
          {{application?.appConfigData?.appSubTitle}}
        </div>
      </div>
      <md-progress-bar *ngIf="authService?.loginProgress" mode="indeterminate" class="progress"></md-progress-bar>
      <div class="form-group">
        <input id="userName" name="userName" required="required" 
          class="form-control" [(ngModel)]="loginData.userName"
          (keyup)="onKeyup()"/>
        <label class="form-label">
          <i class="material-icons">person</i>
        </label>
      </div>
      <div class="form-group">
        <input id="password" name="password" 
          type="password" required="required" 
          class="form-control" [(ngModel)]="loginData.password"
          (keyup)="onKeyup()"/>
        <label class="form-label">
          <i class="material-icons">lock</i>
        </label>
      </div>
      <div class="form-group">
        <label class="form-label">
          <span class="check-box">
            <input id="auto" name="auto" class="check-box" type="checkbox" [(ngModel)]="loginData.auto" (click)="onRememberCheck($event)"
              id="farmCheck">
            <span class="check" [ngStyle]="{'display':loginData.auto ? 'inline-block':'none'}"></span>
          </span>
          <span class="name">下次自动登录</span>
        </label>
      </div>
      <div class="form-group error" *ngIf="loginError">
        <div class="form-error">
          {{loginError}}
        </div>
      </div>
      <div class="form-group">
        <button md-raised-button type="submit" [disabled]="!loginForm.form.valid||(authService.loginProgress&&authService.authReason)">登录</button>
      </div>
    </div>
  </div>
</form>
